home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_02_06 / 2n06020b < prev    next >
Text File  |  1991-04-28  |  465b  |  17 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "snooper.h"
  4.  
  5. FILE *open_stream(const char *fname, const char *mode )
  6. {
  7.     FILE *fp;
  8.     __WATCH(!fname || !(*fname),__SCRN__,
  9.                  d_printf("open_stream(): "
  10.                  "null pointer or -> null filename\n" ));
  11.     fp = fopen(fname,mode);
  12.     __WATCH(fp == NULL, __SCRN__,
  13.                 d_printf("open_stream(): "
  14.                 "can't open file %s\n", fname ));
  15.     return fp;
  16. }
  17.